package com.runa.monitor.platinterface.netservice.equipment.fail;

import com.runa.monitor.comm.dto.Node;
import com.runa.monitor.platinterface.backwork.impl.RccTaskFunction;
import com.runa.monitor.platinterface.backwork.function.TaskFunction;
import com.runa.monitor.platinterface.netservice.connect.commstatus.CommStatus;
import com.runa.persistence.service.LogService;
import com.runa.rccprotocol.dto.equdata.EquData;
import lombok.extern.slf4j.Slf4j;
import java.util.List;

/**
 * 2024/7/5 16:44
 * zhangYB
 */
@Slf4j
public class ProtocolNotMatchDriver extends BaseDriver<String> {


    public ProtocolNotMatchDriver(String serial, Integer timeout) {
        super(serial, timeout);
    }

    @Override
    public void readNodeEqu(List<Node> nodes, TaskFunction function, EquData.EquDataType type) {
//        try {
//            if (function instanceof RccTaskFunction.AllTask) {
//                RccTaskFunction.AllTask allTask = (RccTaskFunction.AllTask)function;
//                LogService.protocolNotMatch(allTask.getTaskNo(), allTask.getId(), allTask.getNodeList().size());
//            }
//            function.doApply(CommStatus.Nothingness.setStatus("协议未匹配"), null);
//        } catch (Exception e) {
//            log.error("readNodeEqu: {} {}", serial(), e);
//        }
    }

}
